package com.example.chap03.controller;



import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class SysController {
    @Autowired
    com.example.demo.service.Sys_roleService sys_roleService;
    @RequestMapping(value = "/saveRole",method = RequestMethod.GET)
    public String savaSys_role(){
        Sys_ sys_role = new com.example.demo.entity.Sys_role();
        sys_role.setName("张三");
        sys_role.getDescription("普通职员");
        int result = sys_roleService.saveSys_role(sys_role);
        if (result>0){
            return "添加员工成功！";
        }else {
            return "添加员工失败！";
        }

    }
}
